package Script.licenceplate;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * description: <br>
 * createTime: 2020/9/1010:11 <br>
 *
 * @author zzh
 */
public class LicencePlateScript {
    static final AtomicInteger couter = new AtomicInteger(0);
    static String[] chars = "0123456789ABCDEFGHJKLMNPQRSTUVWXYZ".split("");
    static final int LEGNTH_PLATE = 5;
    static final String PREFIX_PLATE = "苏A";

    static {
        System.out.println(chars.length);
    }

    public static void dealAll(CheckLicensePlate checkLicensePlate) {
        recurseDeal(checkLicensePlate, "", 1);
    }

    private static void recurseDeal(CheckLicensePlate checkLicensePlate, String str, int index) {
        if(index > LEGNTH_PLATE) {
            couter.addAndGet(1);
            checkLicensePlate.check(PREFIX_PLATE + str);
            return;
        }
        for (String aChar : chars) {
            recurseDeal(checkLicensePlate, str + aChar, index + 1);
        }
    }


    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        dealAll((s) -> true);
        System.out.println(System.currentTimeMillis() - start);
        System.out.println(couter.get());
        System.out.println(Math.pow(34, 5));
    }
}
